<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DummyController
 *
 * @author VAMPIRED
 */
class DummyController extends Zend_Controller_Action {

    public function indexAction(){
                $dictionary = unserialize(file_get_contents(ROOT_PATH . '/data/lang/menu-ar'));
                $dictionary['menu-item4']=$dictionary['menu-item5'];
                $dictionary['menu-item5']='الصور';
//                $dictionary['menu-item4']='7amada belgebna';
                        file_put_contents(ROOT_PATH . '/data/lang/menu-ar', serialize($dictionary));
                var_dump($dictionary);
                die();
    }
    
    
    public function gehadAction() {
        $ar = array(
            'Guest-title' => 'share your opinion',
            'Guest-name' => 'Name',
            'Guest-mail' => 'Email',
            'Guest-message' => 'Message',
            'Guest-Add' => 'Add'
        );
        file_put_contents(ROOT_PATH . '/data/lang/guest-en', serialize($ar));
        $ar = array(
            'Guest-title' => 'شارك برأيك',
            'Guest-name' => 'الأسم',
            'Guest-mail' => 'البريد الإليكتروني',
            'Guest-message' => 'الرسالة',
            'Guest-Add' => 'أضافة الرسالة'
        );
        file_put_contents(ROOT_PATH . '/data/lang/guest-ar', serialize($ar));
        die();
    }
    
    public function readAction() {
        $s=unserialize(file_get_contents(ROOT_PATH . '/data/lang/menu-en'));
        die(print_r($s));
        
    }
    
    public function rtfAction() {
        if ($this->getRequest()->isPost()) {
            $this->view->text = $_POST['form']['info1'];
        }
    }

    public function insertAction() {
        for ($i = 0; $i < 20; $i++) {
            $m = new Media();
            $m->auther = 1;
            $m->category = 1;
            $m->level = 1;
            $m->section = 1;
            $m->title = "قرأن " . $i;
            $m->save();
            unset($m);
        }
        die();
    }

}
